home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / modelers / geomview / sgi.lha / Geomview / Makefile < prev    next >
Makefile  |  1993-12-06  |  2KB  |  79 lines

  1. GEOMROOT=
  2. BINDIR=/usr/local/bin
  3. MANDIR=/usr/catman/local
  4. MMAPACKAGEDIR=
  5.  
  6. SHELL=/bin/sh
  7. INSTALL = ./tools/inst
  8. DIRSEQ = ./tools/dirseq
  9. INSUREDIR=./tools/insuredir
  10.  
  11. install:    install_all
  12.  
  13. install_all:    demand_GEOMROOT install_script install_bin install_man install_mma 
  14.  
  15. install_script: 
  16.     @/bin/rm -f geomview.old
  17.     @cp geomview geomview.old
  18.     @/bin/rm -f geomview
  19.     @sed -e 's|^GEOMROOT=.*$$|GEOMROOT=${GEOMROOT}|' < geomview.old > geomview
  20.     @chmod a+x geomview;
  21.     @echo 'Edited "geomview" to set GEOMROOT=${GEOMROOT}.'
  22.     @${INSUREDIR} ${BINDIR}
  23.     @${INSTALL} geomview ${BINDIR}
  24.  
  25. install_bin:
  26.     @${INSUREDIR} ${BINDIR} ; \
  27.     if ${DIRSEQ} ./bin/sgi ${BINDIR} ; then \
  28.       echo 'The executable files are in ${GEOMROOT}/bin/sgi (not' ; \
  29.       echo '  installed outside the Geomview distribution directory).' ; \
  30.     else \
  31.       for f in `find bin/sgi -type f -print` ; do \
  32.         name=`basename $$f` ; \
  33.         if [ "$$name" != "gvx" ] ; then \
  34.           ${INSTALL} $$f ${BINDIR} ; \
  35.         fi ; \
  36.       done ; \
  37.     fi
  38.     
  39. install_man:
  40.     @mandir=${MANDIR}; \
  41.     if ${DIRSEQ} ./man ${MANDIR} ; then \
  42.       echo 'The manual page files are in ${GEOMROOT}/man (not' ; \
  43.       echo '  installed outside the Geomview distribution directory).';\
  44.     else \
  45.       for f in `find man -name '*.[1-9]' -print` ; do \
  46.         mdir=$$mandir/`expr "$$f" : "man/\([^/]*\)/.*"` ; \
  47.         ${INSUREDIR} $$mdir ; \
  48.         ${INSTALL} $$f $$mdir ; \
  49.       done ; \
  50.     fi
  51.  
  52. install_mma:
  53.     @mmapackagedir=${MMAPACKAGEDIR}; \
  54.     if [ "$$mmapackagedir" != "" ] ; then \
  55.       if ${DIRSEQ} ./mathematica ${MMAPACKAGEDIR} ; then \
  56.         echo 'The Mathematica packages are in ${GEOMROOT}/mathematica (not';\
  57.         echo '  installed outside the Geomview distribution directory).';\
  58.       else \
  59.         ${INSUREDIR} $$mmapackagedir ; \
  60.         for f in `find mathematica -name '*.m' -print` ; do \
  61.           ${INSTALL} $$f $$mmapackagedir ; \
  62.         done ; \
  63.       fi ; \
  64.     fi
  65.  
  66. demand_GEOMROOT:
  67.     @if [ -z "${GEOMROOT}" ]; then \
  68.         echo "Error: GEOMROOT variable not set." >&2; \
  69.         exit 1; \
  70.     fi
  71.     @if [ ! -d "${GEOMROOT}" ]; then \
  72.         echo "Error: GEOMROOT directory ${GEOMROOT} does not exist." >&2;\
  73.         exit 1; \
  74.     fi
  75.     @if [ ! -x ./tools/insuredir ] ; then \
  76.         echo "Error: you do not appear to be in the Geomview root." >&2;\
  77.         echo "  directory.">&2; \
  78.     fi
  79.